home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / September 96 / Re Using QuickDrawGX in ODF.3 < prev    next >
Encoding:
Internet Message Format  |  1996-09-19  |  1.8 KB  |  [TEXT/ttxt]

  1. Subject:     Re: Using QuickDrawGX in ODF
  2. Sent:        9/5/96 7:46 AM
  3. Received:    9/5/96 7:46 AM
  4. From:        "Scott Daniels" <scottdfl@sprynet.com>
  5. Reply-To:    ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List
  7.  
  8.  
  9. Brad,
  10.  
  11. I understand how picture contexts work. What I want to know is how to write
  12. a picture context using quickdraw GX (a bitmap shape context as well). If
  13. you look at the graphics context classes in ODF, (you obviously know) that
  14. the various contexts descend from a base class, with one context for each
  15. type of "context". If one wants to use GX however, there is only one
  16. context provided which appears to be a "view" context. How do I write other
  17. contexts for pictures & bitmapshapes?
  18.  
  19. Scott
  20.  
  21. ----------
  22. > From: Brad Pettit <bpettit@apple.com>
  23. > To: OpenDoc Development Framework Discussion List
  24. <ODF-Interest@CILabs.ORG>
  25. > Subject: Re: Using QuickDrawGX in ODF
  26. > Date: Tuesday, September 03, 1996 3:06 PM
  27. > You're right about the rotated text in that there is no direct support 
  28. > for rotated text in the framework. However, I'm not sure from your 
  29. > question if you ware wondering how picture contexts work. Here is an 
  30. > example.
  31. > // create a 100x100 picture
  32. > FW_CRect picBounds(FW_kFixed0, FW_kFixed0, FW_IntToFixed(100), 
  33. > FW_IntToFixed(100));
  34. > FW_CPicture myPicture; // create an empty picture
  35. > {
  36. >   // create a picture context so that we can draw into the picture
  37. >             FW_CPictureContext picContext(ev, myPicture, picBounds.Width(), 
  38. > picBounds.Height());
  39. >             picContext.SetClipRect(pictureBounds);
  40. >    MyDrawStuffHere(ev, pictureContext, pictureBounds);
  41. > }
  42. > myPicture now contains all the drawing done in MyDrawStuffHere.
  43. > We can draw the picture anywhere using:
  44. > FW_CPictureShape::RenderPicture(viewContext, myPicture, 
  45. > myDestinationRect);
  46. > --Brad